import Vue from 'vue'
import Vuex from 'vuex'

import userAuth from './modules/userAuth'

import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    userAuth
  },
  plugins: [
    createPersistedState({
      storage: window.localStorage,
      // 仅持久化 userAuth 和 ... 模块
      paths: ['userAuth']
    })
  ]
})
